#ifndef INFINITY_SPELLBAR_H
#	define INFINITY_SPELLBAR_H

#include "graphics/renderer.h"
#include "graphics/indexbuffer.h"
#include "graphics/vertexbuffer.h"

#include "container.h"
#include "widget.h"
#include "imagebox.h"

namespace infinity {
	namespace render {

class SpellBar
{
public : //! @name Constants
	//! @{
	static const dw::uint32 SlotsCount = 10;
	static const dw::uint32 SlotDimension = 50;
	static const dw::uint32 SlotOffset = 5;
	//! @}

public : //! @name Construction & Destruction
	//! @{
	SpellBar(Container * container);
	virtual ~SpellBar();
	//! @}

public : //! @name Commands
	//! @{
	void initializeGUI();
	void updateGUI();

	
	inline dw::graphics::VertexBuffer* getVertexBuffer(){ return m_vertexBuffer;}
	inline dw::graphics::IndexBuffer* getIndexBuffer(){ return m_indexBuffer;}

	inline dw::int32 getIndexSelecteur(){return m_indexSelecteur;}
	inline dw::uint32 getTrianglesCount(){return m_trianglesCount;}


	void indexUp();
	void indexDown();

	//!@}
protected :
	void createMesh();
	void updateBuffer();

protected : // @name Data
	//! @{
	dw::graphics::VertexFormat* m_vertexFormat;
	dw::graphics::IndexBuffer* m_indexBuffer;
	dw::graphics::VertexBuffer* m_vertexBuffer;

	Widget* m_root;
	ImageBox m_imagesBoxes[SlotsCount];
	
	dw::int32 m_indexSelecteur;
	ImageBox m_selecteur;

	Container * m_container;

	dw::uint32 m_trianglesCount;
	//! @}
};

	} // namespace render
} // namespace infinity

#endif // !INFINITY_SPELLBAR_H
